<?php
/* @var $model Ad */
/* @var $this AdController */
?>
<?php
if (isset(Yii::app()->session['agree']) && Yii::app()->session['agree']) {
    
} else {
    ?>    
    <script>
        $(document).ready(function() {
    	$('#form-agreement').modal({
    	    keyboard: false
    	});
    	$('#checkbox-agree').change(function() {
    	    var isChecked = $(this).attr('checked');

    	    if (isChecked != null) {
    		$('#btn-agree').attr('data-dismiss', 'modal');
    		$.post('<?php echo SITE_NAME_URL ?>ad/save_agree', {userId:<?php echo user()->id ?>}, function() {

    		});
    	    } else {
    		$.post('<?php echo SITE_NAME_URL ?>ad/save_agree', {userId: ''}, function() {

    		});
    		$('#btn-agree').removeAttr('data-dismiss');
    	    }
    	});
        });
    </script>

    <div id="form-agreement" class="modal hide fade in" aria-hidden="false" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" style="display: block;">
        <div class="modal-header">    	
    	<h3 id="myModalLabel">Terms and conditions</h3>
        </div>
        <div class="modal-body">
    	<label class="checkbox">
    	    <input type="checkbox" value="1" name="post" id="checkbox-agree"/>Agree to the terms to continue</label>
    	<div class="box-agree">
		<?php echo nh(settings()->get('site', 'terms_and_conditions')) ?>
    	</div>

        </div>
        <div class="modal-footer">
    	<a href="<?php echo SITE_NAME_URL ?>" class="btn">Cancel</a>
    	<button class="btn btn-primary" aria-hidden="true" id="btn-agree">Next</button>

        </div>
    </div>
<?php } ?>
<?php
if ($model instanceof Equipment) {
    $this->renderPartial('register/equipment', array('model' => $model));
} elseif ($model instanceof Supply) {
    $this->renderPartial('register/supply', array('model' => $model));
} elseif ($model instanceof Resume) {
    $this->renderPartial('register/resume', array('model' => $model));
} elseif ($model instanceof Job) {
    $this->renderPartial('register/job', array('model' => $model));
} elseif ($model instanceof Vendor) {
    //$this->renderPartial('register/company_source', array('model' => $model, 'eblast' => $params['eblast']));
    $this->renderPartial('register/vendor', array('model' => $model, 'eblast' => $params['eblast']));
} elseif ($model instanceof Technical) {
    $this->renderPartial('register/technical', array('model' => $model, 'eblast' => $params['eblast']));
} elseif ($model instanceof Advertise) {
    $this->renderPartial('register/advertise', array('model' => $model));
}






    